package com.action.blog.board;

import java.util.Map;

import com.db.blogboard.BoardDAO;
import com.db.blogboard.BoardVO;
import com.opensymphony.xwork2.ActionContext;

public class UpdateAction {
	private int jsptype;
	private int ono;
	private int no;
	private String content;
	private String page;
	private BoardVO vo = new BoardVO();
	private BoardDAO blogboard;

	public BoardDAO getBlogboard() {
		return blogboard;
	}

	public void setBlogboard(BoardDAO blogboard) {
		this.blogboard = blogboard;
	}

	public int getNo() {
		return no;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public BoardVO getVo() {
		return vo;
	}

	public int getOno() {
		return ono;
	}

	public void setOno(int ono) {
		this.ono = ono;
	}

	public int getJsptype() {
		return jsptype;
	}

	public void setJsptype(int jsptype) {
		this.jsptype = jsptype;
	}

	public String getPage() {
		return page;
	}

	public void setPage(String page) {
		this.page = page;
	}

	public String bbupdate() throws Exception {
		System.out.println("bbupdate()");
		Map session = ActionContext.getContext().getSession();
		vo.setOno(ono);
		vo.setIdtype(session.get("idtype").toString());
		vo.setNo(no);
		vo = blogboard.boardSelectContentData(vo);

		return "success";
	}

	public String bpupdate() throws Exception {

		System.out.println("bbupdate()");
		Map session = ActionContext.getContext().getSession();
		vo.setOno(ono);
		vo.setIdtype(session.get("idtype").toString());
		vo.setNo(no);
		vo = blogboard.boardSelectContentData(vo);

		return "success";

	}

	public String bgupdate() throws Exception {
		return "success";
	}
}
